import {Component} from '@angular/core';
import {NavController, NavParams} from 'ionic-angular';

import {Backend} from '../../providers/backend';
import {Description} from './tab-my-description';
import {GuidePage} from '../guide/guide';
import {TabAbout} from '../tab-about/tab-about';
@Component({
  templateUrl: 'build/pages/tab-my/tab-my-about.html'
})
export class About {

  static get parameters() {
    return [[NavController], [NavParams], [Backend]];
  }

  constructor(nav, params, backend) {
    this.nav = nav;
    this.params = params;
    this.backend = backend;
    this.contactv = 1;//当前版本号
    this.img = 'asset/img/4.png';
    this.message;//版本信息
    this.backend.versions()
      .then(result => {
        this.contactv = result.v;
        
        if (result.v === this.contactv) {
          this.message = 'The current is the latest version';
        } else {
          this.message = 'Check for updates';
        }
      });
  }
  welcome(daima) {
    if (daima == 1) {
      this.nav.push(Description);
    } else if (daima == 2) {
      this.nav.push(GuidePage);
    } else {
      this.nav.push(TabAbout,{ 'join':11});
    }
  }

}
